Xbasic

ODBC_DT_TO_D Function

Syntax

Date_Value as D = odbc_dt_to_d(C odbc_datetime )

Arguments

odbc_datetime

Date time string in the format "YYYY-MM-DD HH:MM:SS.SSS". Character

Description

Converts a character field containing a Date-Time value in format "YYYY-MM-DD HH:MM:SS.SSS" to a date field.

Discussion

ODBC_DT_TO_D() converts a character Date_Time_String of format "YYYY-MM-DD HH:MM:SS.SSS" to a date value. This function is useful when you link to an ODBC data source that has a date/time field. Since Alpha Anywhere does not have the corresponding field type, the data is displayed as a character value. Use this function to create a calculated field that extracts just the date portion of the date-time value.

Example

odbc_dt_to_d("2003-01-15 11:46:30.003")   ->   {01/15/2003}

See Also